package com.qf.cm.controller;

import com.qf.cm.pojo.Item;
import com.qf.cm.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Description: 公用常量
 * @Data: 2022/9/7 22:37
 * @Pacakge: com.qf.cm.controller
 * @ClassName: ItemController
 * @Author: fan
 */
@Controller
@RequestMapping("item")
public class ItemController {
    @Autowired
    private ItemService itemService;
    @RequestMapping("findItemByIname")
    public ModelAndView findItemByIname(String iname){
        ModelAndView modelAndView = new ModelAndView();
        Item item = itemService.findItemByIname(iname);
        modelAndView.setViewName("/pages/item/item");
        modelAndView.addObject("item",item);
        return modelAndView;
    }
}
